config = require('../config')
Schema = config.Schema
mongoose = config.mongoose

###
  Schema = config.Schema
mongoose = config.mongoose
###
AttachSchema = new Schema({
  category:String
  file_id:String
  file_name:String
  file_size:String
  file_desc:String
  order:Number
  update_at:Date
})

AttachSchema.methods.add =  (req,cb) ->
  this.category = req.param('category')
  this.file_id = req.param('file_id')
  this.file_name = req.param('file_name')
  this.file_size = req.param('file_size')
  this.file_desc = req.param('file_desc')
  this.order = req.param('order')
  this.update_at = new Date
  this.save cb

exports.Attach = mongoose.model 'Attach', AttachSchema